import axios from 'axios'

export function createAxios(options = {}) {
  const defaultOptions = {
    baseURL: '/api',
    // timeout: 12000
  }
  const service = axios.create({
    ...defaultOptions,
    ...options
  })
  return service
}

const request = createAxios()
export default request
